<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>车队申请结算管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
			return false;
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/ordersettle/tOrdersSettle/">车队申请结算列表</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="TOrdersSettle" action="${ctx}/ordersettle/tOrdersSettle/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>车队：</label>
				<form:select path="officeid" class="input-medium">
				<option value="">--请选择--</option>
				<form:options items="${fns:getOfficeListByFlatType(\"1\")}" itemLabel="name" itemValue="id" htmlEscape="false" />
			</form:select>
			<li>
				<span><label>&nbsp;&nbsp;申请日期：</label></span>
				<input type="text" id="createDateQueryStart" name="createDateQueryStart" maxlength="20" readonly class="input-small Wdate"
					value="${tOrdersSettle.createDateQueryStart }"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,maxDate:'#F{$dp.$D(\'createDateQueryEnd\')}'});"/>
				至&nbsp;
				<input type="text" id="createDateQueryEnd" name="createDateQueryEnd" maxlength="20" readonly class="input-small Wdate"
					value="${tOrdersSettle.createDateQueryEnd }"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,minDate:'#F{$dp.$D(\'createDateQueryStart\')}'});"/>
			</li>
			<li><label>状态：</label>
				<form:select path="settlestatus" class="input-medium">
					<option value="">--请选择--</option>
					<form:options items="${fns:getDictList('settlestatus')}" itemLabel="label" itemValue="value" htmlEscape="false" />
				</form:select></li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>结算单号</th>
				<th>结算时间</th>
				<th>申请对象</th>
				<th>结算金额</th>
				<th>状态</th>
				<shiro:hasPermission name="ordersettle:tOrdersSettle:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="tOrdersSettle">
			<tr>
				<td>${tOrdersSettle.settleid}</td>
				<td>
					<fmt:formatDate value="${tOrdersSettle.createDate}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					${tOrdersSettle.officeid.name}
				</td>
				<td>
					${tOrdersSettle.settlemoney}
				</td>
				<td>
					${fns:getDictLabel(tOrdersSettle.settlestatus, 'settlestatus', '无')}
				</td>
				<td>
				<shiro:hasPermission name="ordersettle:tOrdersSettle:view">
    				<a href="${ctx}/ordersettle/tOrdersSettle/form?id=${tOrdersSettle.settleid}">查看</a>
    			</shiro:hasPermission>
    			<shiro:hasPermission name="ordersettle:tOrdersSettle:edit">
    				<c:if test="${tOrdersSettle.settlestatus == 1}">
    				<a href="${ctx}/ordersettle/tOrdersSettle/confirmform?id=${tOrdersSettle.settleid}">确认开票</a>
    				</c:if>
    				<c:if test="${tOrdersSettle.settlestatus == 3}">
					<a href="${ctx}/ordersettle/tOrdersSettle/checkform?id=${tOrdersSettle.settleid}">确认打款</a>
					</c:if>
				</shiro:hasPermission>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>